//
//  BaseViewController.swift
//  OnemeetingDemo
//
//  Created by 张衡 on 2019/12/5.
//  Copyright © 2019 www.onemeeting.1meetingIos. All rights reserved.
//

import Foundation

class BaseViewController: NSViewController {
    
    override func loadView() {
        let view = NSView.init(frame: NSMakeRect(0, 0, 400, 200))
        view.wantsLayer = true
        view.layer?.backgroundColor = color_dark.cgColor
        self.view = view
    }
    
    override func viewWillAppear() {
        super.viewWillAppear()
    }
    
}

extension NSView {
    func toScreenRect() -> NSRect {
        let pointInWindow = self.convert(CGPoint.zero, to: nil)
        let contentRect =  self.window?.convertToScreen(NSRect.init(origin: pointInWindow, size: CGSize.zero))
        return contentRect ?? NSRect.zero
    }
}
